home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / suck-2.6 / suck-2 / suck-2.6.3 / sample / put.news < prev    next >
Text File  |  1995-08-06  |  543b  |  36 lines

  1. #!/bin/sh
  2.  
  3. # this is just a simple script to run the one line sed
  4. # command to strip off the NNTP Posting Header that
  5. # my ISP's newsfeed doesn't like.
  6. # this could be written as a one liner
  7. # sed -e CMD $1 > $2
  8.  
  9. #set -x
  10.  
  11. if [ $# -ne 2 ]; then
  12.     echo
  13.     echo "Usage `basename $0` infile outfile <RETURN>"
  14.     echo
  15.     exit -1
  16. fi
  17.  
  18. SEDCMD="/^NNTP-Posting-Host/d"
  19. OUTFILE=$2
  20. INFILE=$1
  21.  
  22. if [ -f ${INFILE} ]; then
  23.  
  24.     sed -e ${SEDCMD} ${INFILE} > ${OUTFILE}
  25.         
  26.     if [ $? -ne 0 ]; then
  27.         echo "Error"
  28.         exit -1
  29.     fi
  30.  
  31. else
  32.     echo "$1 does not exist"
  33.     exit -1
  34. fi
  35.     
  36.